<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Telefono extends AppModel {
    public $useTable = 'telefonos';
    
    public function regresaBase()
    {
        return $this->getDataSource();
    }  
    public function regresaTelefonosC($id)
    {   
        $t = $this->find('all',array(
            'conditions'=> array('id_cliente'=>$id),
            'order' => 'id ASC',
            'callbacks' => false
          ));
        $telefonos = array();
        for($i = 0;$i<count($t);$i++)
            $telefonos[$i]=$t[$i]['Telefono'];
        return $telefonos;
    }
    public function regresaTelefonosP($id)
    {   
        $t = $this->find('all',array(
            'conditions'=> array('id_prove'=>$id),
            'order' => 'id ASC',
            'callbacks' => false
          ));
        $telefonos = array();
        for($i = 0;$i<count($t);$i++)
            $telefonos[$i]=$t[$i]['Telefono'];
        return $telefonos;
    }
}
?>
